#include <REGX52.H>
#include <INTRINS.h>
#include "Delay.h"
#include "LCD1602.h"
#include "DS18B20.h"
float T;
unsigned char Ack;

void main()
{  
	  DS18B20_ConvertT();
	  Delay(1000);
	  LCD_Init();
	  LCD_ShowString(1,1,"Temperature");
	  // Ack=OneWire_Init();
	  //LCD_ShowNum(2,1,Ack,3);还是一样0表示从机应答 1表示无应答
		while(1)
		{
			DS18B20_ConvertT();
			T=DS18B20_ReadT();
			if(T<0){
				LCD_ShowChar(2,4,'-');	
				T=-T;
			}else{
				LCD_ShowChar(2,4,'+');
			}
			LCD_ShowNum(2,5,T,3);
			LCD_ShowChar(2,8,'.');
			LCD_ShowNum(2,9,(unsigned long)(T*10000)%10000,4);
		}

}